<!DOCTYPE html>
<head>
    <title>登录</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="/static/index/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/static/index/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/static/index/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
    <link href="/static/index/css/bootstrap-social.css" rel="stylesheet" type="text/css">
    <link href="/static/index/css/templatemo_style.css" rel="stylesheet" type="text/css">
    <script src="/static/index/js/jquery-1.8.3.min.js"></script>
    <script src="/static/index/js/jquery.cookie.js"></script>
</head>
<body class="templatemo-bg-image-1">
<div class="container">
    <div class="col-md-6 col-md-offset-3">
        <form class="form-horizontal templatemo-login-form-2" role="form" action="{:url('index/login/doLogin');}" method="post">
            <div class="row">
                <div class="col-md-12">
                    <h1>登录</h1>
                </div>
            </div>
            <div class="row">
                <div class="templatemo-one-signin col-md-12" style="border: 0px;">
                    <div class="form-group">
                        <div class="col-md-12">
                            <div class="templatemo-input-icon-container">
                                <i class="fa fa-user"></i>
                                <input type="text" class="form-control" id="auth"  name="auth" placeholder="用户名/邮箱/手机号">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <div class="templatemo-input-icon-container">
                                <i class="fa fa-lock"></i>
                                <input type="password" class="form-control" id="pwd" name="pwd" placeholder="密码">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" id="remember" name="remember[]"> 七天免登录
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <input type="submit" value="登录" class="btn btn-warning">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-6">
                            <a href="{:url('index/login/qqLogin')}">qq登录</a>
                        </div>
                        <div class="col-md-6" style="text-align: right;">
                            <a href="{:url('index/login/reset');}" class="text-center">忘记密码？</a>
                            <a href="{:url('index/register/index');}" class="text-center">还未注册</a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<script>

    $(function(){
       $('#auth').focus();
    });
    var token = $.cookie('pwd');
   
    $('#remember').change(function(){
        var auth = $('#auth').val();
        var pwd = $('#pwd').val();
        if($(this).is(':checked')){
            $.cookie('flag', 'true', { expires: 7 });
            $.cookie('auth', auth , { expires: 7 });
            $.cookie('pwd', pwd , { expires: 7 });
            $('#auth').val($.cookie('auth'));
            $('#pwd').val($.cookie('pwd'));
        }else{
            $.cookie('flag', 'true', { expires: -7 });
            $.cookie('auth', auth , { expires: -7 });
            $.cookie('pwd', pwd , { expires: -7 });
            $('#auth').val('');
            $('#pwd').val('');
        }
    });

    if($.cookie('flag')){
        $('#remember').attr({'checked':'checked'});
        $('#auth').val($.cookie('auth'));
        $('#pwd').val($.cookie('pwd'));
    }else{
        $('#auth').val('');
        $('#pwd').val('');
    }


</script>
</body>
</html>